// 图表配置
export const options = {
    color: ['#0AA1CA', '#E23D30', '#15C94E', '#8A00AB', '#0CD9E8'],
    legend: {
        show: true,
        // data: legendData,
        textStyle: {
            fontSize: 14,
            color: '#0CD9E8',
        },
    },
    // series: seriesData,
    xAxis: {
        type: '',
        //x轴数据，时间节点
        // data: dataX,
        name: '时间',
        nameTextStyle: {
            fontWeight: 600,
            fontSize: 12,
            color: '#0CD9E8',
        },
        axisLabel: {
            show: true,
            rotate: 0,
            textStyle: {
                color: '#0CD9E8',
                fontSize: 12,
            },
        },
        axisTick: {
            // length:"10%",
            interval: 0, // 间隔 2 个刻度显示一个，即显示索引为 0、2、4 的阶段数据
            show: true,
            length: '50%',
        },
        axisLine: {
            lineStyle: {
                color: '#007BFF',
            },
        },
    },
    yAxis: {
        type: 'value',
        name: '',
        nameLocation: 'end', //name的具体位置，可调整上中下左
        nameTextStyle: {
            fontWeight: 600,
            fontSize: 16,
            color: '#0CD9E8',
        },
        axisLabel: {
            show: true,
            textStyle: {
                color: '#0CD9E8',
                fontSize: 12,
            },
        },
        splitLine: {
            show: true,
            lineStyle: {
                color: '#B2E3FF',
                width: 0.4,
                type: 'dotted',
            },
        },
    },
    // 工具栏,右上角工具区域缩放
    // toolbox: {
    //     show: true,
    //     iconStyle: {
    //         normal: {
    //             color: '#0CD9E8',
    //         },
    //     },
    //     feature: {
    //         dataZoom: {
    //             realtime: false,
    //             yAxisIndex: 'none',
    //         },
    //     },
    // },
    grid: {
        left: '5%',
        right: '10%',

        // 折线图距离盒子右侧的距离为盒子宽度的 10%
    },
    tooltip: {
        trigger: 'axis', // axis   item   none三个值
        backgroundColor: 'rgb(4,32,76)', //悬浮框颜色
        borderColor: '#02E4FF',
        textStyle: {
            color: '#02E4FF',
        },
    },
    dataZoom: [
        {
            type: 'inside',
            start: 0,
            end: 100,
        },

        {
            type: 'slider',
            realtime: true, //拖动滚动条时是否动态的更新图表数据
            height: 15, //滚动条高度
            start: 0, //滚动条开始位置（共100等份）
            end: 100, //结束位置（共100等份）
            fillerColor: '#0C76F3', // 填充颜色
            handleColor: '#0C76F3', // 手柄颜色
        },
    ],
    toolbox: {
        show: true,
        feature: {
            dataZoom: {
                realtime: false,
                yAxisIndex: 'none',
            },
        },

    },
}

export const polar_option = {
    toolbox: {
        feature: {
            saveAsImage: {},
        },
    },
    polar: {
        splitLine: {
            lineStyle: {
                color: '#aaaaaa',
            },
        },
        axisLine: {
            lineStyle: {
                color: '#0259BC',
            },
        },
        axisLabel: {
            textStyle: {
                color: '#0259BC',
            },
        },
        splitArea: {
            areaStyle: {
                color: ['#ffffff', '#f5f5f5'],
            },
        },
        name: {
            textStyle: {
                color: '#0CD9E8',
            },
        },
    },
    radiusAxis: {
        max: 5,
        axisTick: {
            show: true,
        },
        axisLine: {
            show: true,
        },
        axisLabel: {
            show: true,
        },
    },
    angleAxis: {
        type: 'value',
        startAngle: 0,
        min: 0,
        max: 360,
        interval: 30,
        axisTick: {
            show: true,
        },
        axisLine: {
            show: true,
        },
        axisLabel: {
            show: true,
        },
    },
    series: [
        {
            type: 'line',
            coordinateSystem: 'polar',
            data: null,
            symbolSize: 2,
            itemStyle: {
                normal: {
                    color: '#FFDC00',
                },
            },
            areaStyle: {
                normal: {
                    opacity: 0.5,
                },
            },
            stack: 'a',
        },
    ],
}

export const circular_option = {
    title: {
        text: 'circular',
    },

    radar: {
        shape: 'circle',
        indicator: null,
        axisLine: {
            lineStyle: {
                color: '#0883D8', // 设置轴线颜色
                width: 0, // 设置轴线宽度为1像素
                type: 'dotted', // 设置轴线为点状线样式
            },
        },
        axisLabel: {
            textStyle: {
                fontSize: 12, // 设置字体大小为12像素
                color: '#666', // 设置字体颜色为灰色
            },
        },
        splitLine: {
            lineStyle: {
                color: ['#E43E30', '#FBC423'], // 设置分割线的颜色为黑色和灰色
                width: 0, // 设置分割线宽度为1像素
                type: 'dashed', // 设置分割线为虚线样式
            },
        },
        splitNumber: 0,
    },
    series: [
        {
            lineStyle: {
                smooth: true,
                color: '#FFF200',
            },
            areaStyle: {
                color: 'rgba(0, 0, 0, 0)', // 修改雷达图的填充颜色和透明度
            },
            name: ' ',
            type: 'radar',

            data: [
                {
                    value: [],
                    name: ' ',
                    symbolSize: 2,
                    itemStyle: {
                        normal: {
                            color: '#F9BD12', // 设置点的颜色为红色
                        },
                    },
                },
            ],
        },
    ],
}

export const lineConfig = {
    valueIndex: 0,
    symbol: 'none',
    symbolSize: 10,
    valueDim: 'x',
    data: [{ xAxis: 0 }],
    lineStyle: {
        normal: {
            color: '#FCF3D9',
            width: 1,
            type: 'dashed',
        },
    },
    label: {
        normal: {
            show: true,
            fontSize: 12,
            color: '#FCF3D9',
            formatter: null,
        },
    },
}
export const graphicConfig = {
    id: 'grap1',
    type: 'rect',
    z: 101,
    shape: {
        width: 10,
        height: 1800,
    },
    // position: [myChart.convertToPixel({ xAxisIndex: 0 }, this.mark_start.index), 80],

    draggable: true,
    invisible: true,
    style: {
        fill: 'rgba(255,0,0)',
        stroke: 'rgba(0,0,0,0.3)',
        lineWidth: 10,
    },
    cursor: 'col-resize',
    ondrag: null,
    ondragstart: null,
}

//波形图配置功能
export const waveEventConfig = [
    {
        fnHandler: 'downloadData',
        btnName: '导出波形数据',
    },
    {
        fnHandler: 'setMarkPoint',
        btnName: '添加标注',
    },
    {
        fnHandler: 'setSecondLine',
        btnName: '双游标',
    },
    {
        fnHandler: 'lockDoubleLine',
        btnName: '锁定游标',
    },
]
// 频谱 和包络谱 配置功能
export const freEventConfig = [
    {
        fnHandler: 'downloadData',
        btnName: '导出频谱数据',
    },
    {
        fnHandler: 'setMarkPoint',
        btnName: '添加标注',
    },
    {
        fnHandler: 'setFreDouCount',
        btnName: '频带数量',
    },
    {
        fnHandler: 'freDoubling',
        btnName: '倍频',
    },
    {
        fnHandler: 'sideFre',
        btnName: '边频',
    },
]
